package app.netant.book.d3zww;

import org.jsoup.select.Elements;

import app.netant.book.base.BaseDetail;
/**
 * 
 * @author JiaJ
 *
 */
public class D3zwwDetail extends BaseDetail {

	public D3zwwDetail(String netSite) {
		super(netSite);
		this.preHref = "http://www.d3zww.com";
	}

	@Override
	public void analyseTitle() {
		Elements parts = this.select("#main .box .book_info #info h1");
		if(parts.size()>0){
			String title = parts.get(0).text();
			System.out.println("【Title】:"+title);
			this.entity.setNovelName(title);
			this.entity.setNovelFullName(title+".txt");
		}
	}

	@Override
	public void analyseTags() {
		
	}

	@Override
	public void analyseMemo() {
		
	}

	@Override
	public void analyseHref() {
		Elements parts = this.select("#main .box .book_info #info .options a.item.yellow");
		if(parts.size()>0){
			String href = parts.get(0).attr("href");
			if(href.startsWith("/")){
				href = this.preHref + href;
			}
			System.out.println("【Href】:"+href);
			this.entity.setDownPath(href);
		}
	}
	
	@Override
	public void analyseType() {
		Elements parts = this.select("#main .box .title a");
		if(parts.size()>1){
			String type = parts.get(1).text();
			System.out.println("【Type】:"+type);
			this.entity.setNovelType(type);
		}
	}
	
	public static void main(String[] args) {
		D3zwwDetail detail = new D3zwwDetail("http://www.d3zww.com/book/98/98967/index.html");
		detail.test();
	}



}
